﻿@model IEnumerable<Emoney.UserTraining.Model.Traning_Lecturer>

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <link href="@Url.Content("~/css/style.css")" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/jquery-1.7.1.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script type="text/javascript">
        function AddLecturer() {
            location.href = "../aspx/AddLecturer.aspx";
        }

        function deleteLecturer(id) {
            if (confirm("确定要删除该讲师么？")) {
                $.ajax({
                    type: "POST",
                    async: false,
                    url: "../aspx/ajaxNetworkMeeting.ashx",
                    data: { action: "DeleteTraningLecturer", id: id },
                    success: function (msg) {
                        alert(msg);
                        window.location.href = "../Temporary/TraningLecturerList";
                    },
                    beforeSend: function () {
                    },
                    complete: function () {
                        //$("#loadingImg").remove();
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        //alert(XMLHttpRequest.status);
                    }
                });
            }
        }
    </script>
</head>
<body>
    <table>
        <tr>
            <td>
                <input type="button" value="添加" class="common_button" onclick="AddLecturer();" /></td>
        </tr>
    </table>
    <table cellspacing="0" cellpadding="3" rules="all" border="1" id="GridView1" style="background-color: White; border-color: #CCCCCC; width: 99%; border-collapse: collapse;">
        <tr style="background-color: #E3EFFB;">
            <th scope="col">ID
            </th>
            <th scope="col">讲师
            </th>
            <th scope="col">简介
            </th>
            <th scope="col">头像地址
            </th>
            <th scope="col">讲师类型
            </th>
            <th scope="col"></th>
        </tr>
        @if (Model == null || Model.Count() == 0)
        {
            <tr style="color: #000066;">
                <td colspan="6" style="text-align: center;">无数据</td>
            </tr>
        }
        @foreach (var item in Model)
        {
            <tr style="color: #000066;">
                <td>
                    @Html.DisplayFor(modelItem => item.id)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.lecturerName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.lecturerDetail)
                </td>
                <td>
                    <img style="width:95px; height:95px;" src="@item.lecturerImage" />
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.lecturerType)
                </td>
                <td>
                    <a href="~/aspx/AddLecturer.aspx?id=@item.id">修改</a> <a href="#" onclick="deleteLecturer(@item.id);">删除</a>
                </td>
            </tr>
        }

    </table>
</body>
</html>
